#define yy_create_buffer VL_create_buffer
#define yy_delete_buffer VL_delete_buffer
#define yy_scan_buffer VL_scan_buffer
#define yy_scan_string VL_scan_string
#define yy_scan_bytes VL_scan_bytes
#define yy_flex_debug VL_flex_debug
#define yy_init_buffer VL_init_buffer
#define yy_flush_buffer VL_flush_buffer
#define yy_load_buffer_state VL_load_buffer_state
#define yy_switch_to_buffer VL_switch_to_buffer
#define yyin VLin
#define yyleng VLleng
#define yylex VLlex
#define yyout VLout
#define yyrestart VLrestart
#define yytext VLtext
#define yywrap VLwrap

#line 20 "lexor.cc"
/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
//#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */

#ifdef __TURBOC__
 #pragma warn -rch
 #pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an unsigned
 * integer for use as an array index.  If the signed char is negative,
 * we want to instead treat it as an 8-bit unsigned char, hence the
 * double cast.
 */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)

/* Enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN.
 */
#define BEGIN yy_start = 1 + 2 *

/* Translate the current start state into a value that can be later handed
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
 * compatibility.
 */
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START

/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#define YY_BUF_SIZE 16384

typedef struct yy_buffer_state *YY_BUFFER_STATE;

extern int yyleng;
extern FILE *yyin, *yyout;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* The funky do-while in the following #define is used to turn the definition
 * int a single C statement (which needs a semi-colon terminator).  This
 * avoids problems with code like:
 *
 * 	if ( condition_holds )
 *		yyless( 5 );
 *	else
 *		do_something_else();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the yyless() call.
 */

/* Return all but the first 'n' matched characters back to the input stream. */

#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		*yy_cp = yy_hold_char; \
		YY_RESTORE_YY_MORE_OFFSET \
		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, yytext_ptr )

/* The following is because we cannot portably get our hands on size_t
 * (without autoconf's help, which isn't available because we want
 * flex-generated scanners to compile on their own).
 */
typedef unsigned int yy_size_t;


struct yy_buffer_state
	{
	FILE *yy_input_file;

	char *yy_ch_buf;		/* input buffer */
	char *yy_buf_pos;		/* current position in input buffer */

	/* Size of input buffer in bytes, not including room for EOB
	 * characters.
	 */
	yy_size_t yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	int yy_n_chars;

	/* Whether we "own" the buffer - i.e., we know we created it,
	 * and can realloc() it to grow it, and should free() it to
	 * delete it.
	 */
	int yy_is_our_buffer;

	/* Whether this is an "interactive" input source; if so, and
	 * if we're using stdio for input, then we want to use getc()
	 * instead of fread(), to make sure we stop fetching input after
	 * each newline.
	 */
	int yy_is_interactive;

	/* Whether we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
	/* When an EOF's been seen but there's still some text to process
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
	 * shouldn't try reading from the input source any more.  We might
	 * still have a bunch of tokens to match, though, because of
	 * possible backing-up.
	 *
	 * When we actually see the EOF, we change the status to "new"
	 * (via yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2
	};

static YY_BUFFER_STATE yy_current_buffer = 0;

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 */
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;

static int yy_n_chars;		/* number of characters read into yy_ch_buf */


int yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void yyrestart YY_PROTO(( FILE *input_file ));

void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)

typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	yytext_ptr = yy_bp; \
	yytext_ptr -= yy_more_len; \
	yyleng = (int) (yy_cp - yytext_ptr); \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define YY_NUM_RULES 108
#define YY_END_OF_BUFFER 109
static yyconst short int yy_accept[473] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,   80,   80,   98,   98,  109,  107,    3,    4,
       37,   38,   37,  107,   37,  107,   37,   37,   37,   37,
       37,   76,   37,   37,   37,   69,  107,   37,  107,   37,
       37,    3,   37,  107,    9,   10,    9,  108,    6,    7,
       43,   41,   42,   43,   37,   37,   37,   68,   37,   60,
       63,   62,   61,   66,   67,   64,   65,   80,   81,   98,
       99,   23,   71,   27,    0,    0,    0,    0,    0,   12,
       13,   21,   34,   35,   33,    8,    5,    0,   76,    0,
       14,   18,   22,   20,   19,   16,   69,   70,   31,  106,

        0,   26,   32,   30,   29,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,   11,
       40,   39,    0,    0,    0,    0,    0,   80,   98,   25,
       28,    0,   73,    0,   72,    0,   75,    0,   74,    0,
       36,    5,   77,    0,   78,   15,   24,   17,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,   72,   77,    0,   78,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,   48,   53,   49,   54,   56,   55,   44,   45,   47,
       46,   57,   58,   59,   51,   52,   50,    0,   77,    0,
        0,    0,    0,    0,    0,    0,  101,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,   77,    0,    0,    0,    0,    0,    0,
      101,  101,    0,    0,  102,    0,  103,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  105,    0,    0,    0,
        0,  100,    0,    0,    0,    0,  102,  102,    0,  103,
      103,    0,    0,    0,    0,    0,    0,    0,    0,    0,

      105,  105,   96,    0,    0,    0,    0,  100,  100,    0,
        0,    0,    0,    0,  104,    0,    0,    0,   92,    0,
        0,    0,    0,   96,   96,    0,    0,    0,    0,    0,
        0,    0,    0,  104,  104,    0,    0,    0,   92,   92,
       93,    0,    0,    0,    0,    1,    0,    0,    0,    0,
        0,    0,    0,    2,    0,    0,   93,   93,    0,   79,
        0,    0,    1,    1,   82,    0,    0,    0,    0,   89,
        2,    0,    0,    0,    0,    0,   82,   82,    0,    0,
        0,    0,   89,   89,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,   88,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,   88,   88,    0,    0,
        0,    0,   97,    0,   85,   84,    0,    0,    0,    0,
       94,    0,   97,    0,   85,   85,   84,   84,    0,    0,
        0,    0,   94,   94,    0,    0,    0,   87,   90,    0,
       95,    0,   86,   87,   87,   90,   90,    0,   95,   95,
        0,   86,   86,   91,    0,   91,   91,    0,   83,   83,
       83,    0
    } ;

static yyconst int yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    2,    3,    4,
        1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   10,   17,   18,   19,   20,   21,   22,
       22,   22,   22,   22,   22,   23,   23,   24,   10,   25,
       26,   27,   28,   10,   29,   30,   29,   31,   32,   33,
       34,   35,   34,   34,   34,   36,   34,   37,   38,   39,
       34,   40,   41,   34,   34,   34,   34,   42,   34,   43,
       10,   44,   10,   45,   46,   47,   48,   49,   50,   51,

       52,   53,   34,   54,   55,   34,   34,   56,   57,   58,
       59,   60,   34,   61,   62,   63,   64,   65,   34,   42,
       66,   43,   10,   67,   10,   68,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static yyconst int yy_meta[69] =
    {   0,
        1,    2,    3,    4,    3,    1,    1,    1,    5,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    6,
        6,    6,    6,    1,    1,    1,    1,    7,    6,    6,
        6,    6,    6,    5,    5,    5,    5,    5,    5,    5,
        5,    6,    6,    1,    1,    6,    1,    6,    6,    6,
        6,    6,    6,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    1,    1
    } ;

static yyconst short int yy_base[511] =
    {   0,
        0,   67,   67,   69,    0,    0, 1025, 1024,   72,   73,
      105,   83, 1023, 1022, 1021, 1020, 1023, 1030, 1030, 1030,
      996, 1030, 1030,    0, 1010,   70, 1005,   60,  995,   54,
       74,  128,   69,   70,   72,    0,    0,  950,  101,  950,
      112,  134,  960,  180, 1030, 1030,  996, 1030, 1030, 1030,
     1030, 1030, 1030,   83,  147,   88,   83,  170, 1030,    0,
        0,    0,    0,    0,    0,    0,    0,    0, 1030,    0,
     1030,  988,    0, 1002,  166,  198,  150,  234,  175,  243,
     1030, 1030, 1030, 1030, 1030, 1030,    0,  177,  229,  243,
      987, 1030,  985, 1030, 1030,  983,    0,    0, 1030,  212,

      957, 1030, 1030, 1030, 1030,  265,  232,  953,  955,   57,
      114,  120,  951,  946,  943,  951,  938,  946,  149, 1030,
     1030, 1030,  257,  269,  280,  156,  282,    0,    0, 1030,
     1030,  310,  286,  313,  319,  220,  266,  340,  327,  361,
     1030,    0,  356,  369,  373, 1030, 1030, 1030,  947,   76,
      946,  247,  940,  941,  235,  934,  933,  269,  943,  943,
      934,  210,  932,  928,  929,  931,  177,  935,  972,  971,
      970,  969,  968,  967,  966,  965,  964,  963,  962,  961,
      960,  959,  958,  957,  377,  383,  404,  390,  922,  270,
      919,  916,  911,  231,  918,  917,  912,  914,  378,  910,

      905,  908,  895,  900,  894,  904,  895,  902,  894,  900,
      895, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030,
     1030, 1030, 1030, 1030, 1030, 1030, 1030,  419,  423,  886,
      894,  943,  896,  888,  879,  895,  369,  887,  890,  888,
      879,  886,  874,  932,  876,  885,  882,  870,  871,  869,
      872,  876,  873,  427,  871,  314,  874,  873,  878,  867,
        0,  382,  870,  865,  429,  861,  449,  868,  454,  858,
      858,  866,  867,  862,  863,  854,  453,  862,  847,  902,
      855,  458,  850,  854,  859,  848,    0,  462,  840,    0,
      476,  850,  463,  840,  842,  836,  842,  832,  839,  828,

        0,  485,  489,  827,  859,  854,  797,    0,  493,  786,
      792,  771,  773,  765,  497,  320,  758,  745,  501,  740,
      720,  719,  718,    0,  505,  703,  492,  689,  689,  673,
      667,  667,  663,    0,  514,  705,  645,  648,    0,  518,
      522,  647,  640,  628,  590,  508,  586,  582,  571,  565,
      569,  555,  607,    0,  548,  556,    0,  530,  549, 1030,
      546,  531,    0,  516,  538,  544,  525,  519,  523,  542,
        0,  528,  507,  518,  511,  495,    0,  546,  286,  491,
      497,  488,    0,  550,  489,  482,  462,  476,  452,  456,
      461,  447,  448,  445,  437,  434,  429,  416,  420,  410,

      404,  399,  402,  405,  373,  554,  366,  376,  355,  356,
      364,  351,  355,  344,  337,  325,    0,  558,  324,  316,
      297,  303,  562,  296,  566,  570,  298,  288,  281,  249,
      574,  239,  578,  243,    0,  582,    0,  586,  210,  196,
      191,  178,    0,  590,  152,  146,  102,  594,  598,   91,
      602,   79,  606,    0,  610,    0,  614,   82,    0,  618,
       50,    0,  622,  626,   40,    0,  630,   32,  634,    0,
      638, 1030,  643,  650,  657,  664,  671,  678,  681,  683,
      689,  696,  703,  708,  715,  722,  729,  736,  743,  750,
      757,  764,  771,  778,  785,  792,  799,  806,  813,  820,

      827,  834,  841,  848,  855,  862,  869,  876,  883,  890
    } ;

static yyconst short int yy_def[511] =
    {   0,
      472,    1,  473,  473,  474,  474,  475,  475,  476,  476,
        1,   11,  477,  477,  478,  478,  472,  472,  472,  472,
      472,  472,  472,  479,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  480,  481,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  480,
      480,  480,  480,  480,  480,  480,  480,  482,  472,  483,
      472,  472,  479,  472,  472,  472,  484,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  485,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  480,  481,  472,  472,

      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  482,  483,  472,
      472,  472,  472,  472,  472,  484,  484,  472,  472,  472,
      472,  485,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,

      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  486,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      486,  486,  472,  472,  487,  472,  488,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  489,  472,  472,  490,
      472,  491,  472,  472,  472,  472,  487,  487,  472,  488,
      488,  472,  472,  472,  472,  472,  472,  472,  472,  472,

      489,  489,  492,  472,  490,  472,  472,  491,  491,  472,
      472,  472,  472,  472,  493,  472,  472,  472,  494,  472,
      472,  472,  472,  492,  492,  472,  472,  472,  472,  472,
      472,  472,  472,  493,  493,  495,  472,  472,  494,  494,
      496,  472,  472,  472,  472,  497,  472,  472,  472,  472,
      472,  472,  495,  498,  472,  472,  496,  496,  472,  472,
      472,  472,  497,  497,  499,  472,  472,  472,  472,  500,
      498,  472,  472,  472,  472,  472,  499,  499,  472,  472,
      472,  472,  500,  500,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,

      472,  472,  472,  472,  472,  501,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  501,  501,  472,  472,
      472,  472,  472,  472,  502,  503,  472,  472,  472,  472,
      504,  472,  472,  472,  502,  502,  503,  503,  472,  472,
      472,  472,  504,  504,  472,  472,  472,  505,  506,  472,
      507,  472,  508,  505,  505,  506,  506,  472,  507,  507,
      472,  508,  508,  509,  472,  509,  509,  472,  510,  510,
      510,    0,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,

      472,  472,  472,  472,  472,  472,  472,  472,  472,  472
    } ;

static yyconst short int yy_nxt[1099] =
    {   0,
       18,   19,   19,   20,   19,   21,   22,   23,   24,   23,
       25,   26,   27,   23,   28,   29,   30,   23,   31,   32,
       32,   32,   32,   23,   33,   34,   35,   23,   36,   36,
       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
       36,   36,   36,   37,   38,   36,   39,   36,   36,   36,
       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
       36,   36,   36,   36,   36,   36,   40,   41,   42,   42,
       46,   42,   46,   81,   43,   52,   52,   84,   53,   53,
       85,   47,  469,   47,   42,   42,   82,   42,   86,  121,
       43,  468,   87,   91,   92,   93,   94,   95,   96,   75,

       76,   81,  100,  100,   77,  100,   84,   78,  155,   85,
       79,  156,  465,   44,   82,   54,   54,   55,   75,   56,
       76,   57,  103,   77,   58,   58,  122,  190,   78,   44,
      156,   79,   59,  464,   60,  106,  106,   61,  106,   62,
       63,   64,  461,   65,   66,   88,   67,   89,   89,   89,
       89,  101,  136,   60,  136,  458,  104,   61,   62,   90,
       63,   80,   64,  453,   65,   66,  123,  124,  132,  157,
      132,  158,  159,   89,  125,  179,  180,  160,  105,   90,
      107,  100,  100,  181,  100,  133,  133,   88,  126,   89,
       89,   89,   89,  133,  452,  127,  143,  143,  143,  143,

      134,   90,  134,  451,   75,   76,  167,  133,  133,   77,
      168,  133,   78,  100,  100,   89,  100,  135,  135,  135,
      135,   90,  136,   75,  136,   76,  209,  210,   77,  109,
      110,  111,  450,   78,  112,  113,  138,  114,  138,  115,
      116,  117,  118,  119,  140,  140,   88,  140,   89,   89,
       89,   89,  449,  139,  139,  139,  141,  448,  144,  144,
       90,  139,  145,  145,  145,  145,  106,  106,  472,  106,
      472,  203,  447,  204,   89,  139,  139,  169,  230,  139,
       90,  109,  150,  111,  170,  234,  151,  194,  172,  114,
      195,  115,  116,  117,  118,  152,  173,  446,  171,  175,

      176,  182,  183,  445,  191,  133,  133,  177,  168,  442,
      174,  107,  132,  133,  132,  134,  198,  134,  256,  199,
      280,  178,  231,  184,  316,  195,  336,  133,  133,  133,
      133,  133,  135,  135,  135,  135,  390,  133,  185,  185,
      185,  185,  138,  441,  138,  391,  139,  139,  139,  392,
      440,  133,  133,  439,  139,  133,  434,  432,  431,  139,
      139,  139,  140,  140,  185,  140,  430,  139,  139,  139,
      262,  262,  139,  262,  141,  186,  186,  186,  186,  429,
      428,  139,  139,  262,  262,  139,  262,  187,  145,  145,
      145,  145,  188,  188,  188,  188,  185,  185,  185,  185,

      427,  186,  186,  186,  186,  186,  426,  187,  425,  188,
      188,  188,  188,  424,  187,  423,  422,  421,  188,  228,
      228,  420,  185,  229,  229,  229,  229,  239,  186,  419,
      288,  288,  240,  288,  187,  188,  416,  241,  229,  229,
      229,  229,  254,  254,  254,  254,  254,  254,  254,  254,
      291,  291,  415,  291,  302,  302,  414,  302,  269,  309,
      309,  413,  309,  288,  288,  412,  288,  316,  254,  411,
      410,  409,  254,  293,  293,  293,  293,  291,  291,  408,
      291,  407,  293,  293,  293,  293,  302,  302,  406,  302,
      325,  325,  405,  325,  309,  309,  327,  309,  335,  335,

      404,  335,  340,  340,  403,  340,  325,  325,  402,  325,
      401,  346,  346,  346,  346,  335,  335,  400,  335,  340,
      340,  399,  340,  358,  358,  398,  358,  364,  364,  364,
      364,  358,  358,  397,  358,  364,  364,  364,  364,  378,
      378,  396,  378,  384,  384,  395,  384,  378,  378,  394,
      378,  384,  384,  393,  384,  418,  418,  389,  418,  418,
      418,  388,  418,  433,  433,  387,  433,  436,  436,  386,
      436,  438,  438,  385,  438,  444,  444,  382,  444,  433,
      433,  381,  433,  436,  436,  380,  436,  438,  438,  379,
      438,  444,  444,  376,  444,  455,  455,  375,  455,  457,

      457,  374,  457,  460,  460,  373,  460,  463,  463,  372,
      463,  455,  455,  354,  455,  457,  457,  370,  457,  460,
      460,  369,  460,  463,  463,  368,  463,  467,  467,  367,
      467,  467,  467,  366,  467,  471,  471,  365,  471,  471,
      471,  362,  471,   45,   45,   45,   45,   45,   45,   45,
       48,   48,   48,   48,   48,   48,   48,   49,   49,   49,
       49,   49,   49,   49,   51,   51,   51,   51,   51,   51,
       51,   68,   68,   68,   68,   68,   68,   68,   70,   70,
       70,   70,   70,   70,   70,   73,   73,   97,   97,   98,
      361,  360,  359,   98,   98,   98,  128,  128,  128,  356,

      128,  128,  128,  129,  129,  129,  355,  129,  129,  129,
      137,  354,  352,  137,  137,  142,  142,  142,  351,  142,
      142,  142,  261,  261,  261,  350,  261,  261,  261,  287,
      287,  287,  349,  287,  287,  287,  290,  290,  290,  348,
      290,  290,  290,  301,  301,  301,  347,  301,  301,  301,
      305,  305,  305,  305,  305,  305,  305,  308,  308,  308,
      345,  308,  308,  308,  324,  324,  324,  344,  324,  324,
      324,  334,  334,  334,  343,  334,  334,  334,  339,  339,
      339,  342,  339,  339,  339,  353,  353,  353,  353,  353,
      353,  353,  357,  357,  357,  341,  357,  357,  357,  363,

      363,  363,  338,  363,  363,  363,  371,  371,  371,  337,
      371,  371,  371,  377,  377,  377,  333,  377,  377,  377,
      383,  383,  383,  332,  383,  383,  383,  417,  417,  417,
      331,  417,  417,  417,  435,  435,  435,  330,  435,  435,
      435,  437,  437,  437,  329,  437,  437,  437,  443,  443,
      443,  328,  443,  443,  443,  454,  454,  454,  327,  454,
      454,  454,  456,  456,  456,  306,  456,  456,  456,  459,
      459,  459,  326,  459,  459,  459,  462,  462,  462,  323,
      462,  462,  462,  466,  466,  466,  322,  466,  466,  466,
      470,  470,  470,  321,  470,  470,  470,  320,  319,  318,

      317,  315,  314,  313,  312,  311,  310,  307,  306,  304,
      303,  300,  299,  298,  297,  296,  295,  294,  292,  289,
      286,  285,  284,  283,  282,  281,  279,  278,  277,  276,
      275,  274,  273,  272,  271,  270,  269,  268,  267,  266,
      265,  264,  263,  260,  259,  258,  257,  256,  234,  255,
      253,  252,  251,  250,  249,  248,  247,  246,  245,  244,
      243,  242,  238,  237,  236,  235,  233,  232,  209,  230,
      227,  226,  225,  224,  223,  222,  221,  220,  219,  218,
      217,  216,  215,  214,  213,  212,  211,  208,  207,  206,
      205,  202,  201,  200,  197,  196,  193,  192,  159,  189,

      166,  165,  164,  163,  162,  161,  154,  153,  149,  148,
      147,  146,  131,  130,  120,  108,  102,   99,   83,   80,
       74,   72,  472,   71,   71,   69,   69,   50,   50,   17,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472

    } ;

static yyconst short int yy_chk[1099] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    2,
        3,    2,    4,   28,    2,    9,   10,   30,    9,   10,
       30,    3,  468,    4,   12,   12,   28,   12,   31,   54,
       12,  465,   31,   33,   33,   34,   34,   35,   35,   26,

       26,   56,   39,   39,   26,   39,   57,   26,  110,   57,
       26,  110,  461,    2,   56,    9,   10,   11,   26,   11,
       26,   11,   41,   26,   11,   11,   54,  150,   26,   12,
      150,   26,   11,  458,   11,   42,   42,   11,   42,   11,
       11,   11,  452,   11,   11,   32,   11,   32,   32,   32,
       32,   39,   77,   11,   77,  450,   41,   11,   11,   32,
       11,   55,   11,  447,   11,   11,   55,   55,   75,  111,
       75,  111,  112,   32,   55,  126,  126,  112,   41,   32,
       42,   44,   44,  126,   44,   75,   75,   58,   55,   58,
       58,   58,   58,   75,  446,   55,   88,   88,   88,   88,

       76,   58,   76,  445,   79,   79,  119,   75,   75,   79,
      119,   75,   79,  100,  100,   58,  100,   76,   76,   76,
       76,   58,  136,   79,  136,   79,  167,  167,   79,   44,
       44,   44,  442,   79,   44,   44,   78,   44,   78,   44,
       44,   44,   44,   44,   80,   80,   89,   80,   89,   89,
       89,   89,  441,   78,   78,   78,   80,  440,   90,   90,
       89,   78,   90,   90,   90,   90,  106,  106,  137,  106,
      137,  162,  439,  162,   89,   78,   78,  123,  194,   78,
       89,  107,  107,  107,  123,  194,  107,  155,  124,  107,
      155,  107,  107,  107,  107,  107,  124,  434,  123,  125,

      125,  127,  127,  432,  152,  133,  133,  125,  152,  430,
      124,  106,  132,  133,  132,  134,  158,  134,  256,  158,
      256,  125,  190,  127,  316,  190,  316,  133,  133,  132,
      132,  133,  134,  134,  134,  134,  379,  132,  135,  135,
      135,  135,  138,  429,  138,  379,  139,  139,  139,  379,
      428,  132,  132,  427,  139,  132,  424,  422,  421,  138,
      138,  138,  140,  140,  135,  140,  420,  138,  139,  139,
      237,  237,  139,  237,  140,  143,  143,  143,  143,  419,
      416,  138,  138,  262,  262,  138,  262,  143,  144,  144,
      144,  144,  145,  145,  145,  145,  185,  185,  185,  185,

      415,  143,  186,  186,  186,  186,  414,  143,  413,  188,
      188,  188,  188,  412,  186,  411,  410,  409,  145,  187,
      187,  408,  185,  187,  187,  187,  187,  199,  186,  407,
      265,  265,  199,  265,  186,  188,  405,  199,  228,  228,
      228,  228,  229,  229,  229,  229,  254,  254,  254,  254,
      267,  267,  404,  267,  277,  277,  403,  277,  269,  282,
      282,  402,  282,  288,  288,  401,  288,  293,  229,  400,
      399,  398,  254,  269,  269,  269,  269,  291,  291,  397,
      291,  396,  293,  293,  293,  293,  302,  302,  395,  302,
      303,  303,  394,  303,  309,  309,  327,  309,  315,  315,

      393,  315,  319,  319,  392,  319,  325,  325,  391,  325,
      390,  327,  327,  327,  327,  335,  335,  389,  335,  340,
      340,  388,  340,  341,  341,  387,  341,  346,  346,  346,
      346,  358,  358,  386,  358,  364,  364,  364,  364,  365,
      365,  385,  365,  370,  370,  382,  370,  378,  378,  381,
      378,  384,  384,  380,  384,  406,  406,  376,  406,  418,
      418,  375,  418,  423,  423,  374,  423,  425,  425,  373,
      425,  426,  426,  372,  426,  431,  431,  369,  431,  433,
      433,  368,  433,  436,  436,  367,  436,  438,  438,  366,
      438,  444,  444,  362,  444,  448,  448,  361,  448,  449,

      449,  359,  449,  451,  451,  356,  451,  453,  453,  355,
      453,  455,  455,  353,  455,  457,  457,  352,  457,  460,
      460,  351,  460,  463,  463,  350,  463,  464,  464,  349,
      464,  467,  467,  348,  467,  469,  469,  347,  469,  471,
      471,  345,  471,  473,  473,  473,  473,  473,  473,  473,
      474,  474,  474,  474,  474,  474,  474,  475,  475,  475,
      475,  475,  475,  475,  476,  476,  476,  476,  476,  476,
      476,  477,  477,  477,  477,  477,  477,  477,  478,  478,
      478,  478,  478,  478,  478,  479,  479,  480,  480,  481,
      344,  343,  342,  481,  481,  481,  482,  482,  482,  338,

      482,  482,  482,  483,  483,  483,  337,  483,  483,  483,
      484,  336,  333,  484,  484,  485,  485,  485,  332,  485,
      485,  485,  486,  486,  486,  331,  486,  486,  486,  487,
      487,  487,  330,  487,  487,  487,  488,  488,  488,  329,
      488,  488,  488,  489,  489,  489,  328,  489,  489,  489,
      490,  490,  490,  490,  490,  490,  490,  491,  491,  491,
      326,  491,  491,  491,  492,  492,  492,  323,  492,  492,
      492,  493,  493,  493,  322,  493,  493,  493,  494,  494,
      494,  321,  494,  494,  494,  495,  495,  495,  495,  495,
      495,  495,  496,  496,  496,  320,  496,  496,  496,  497,

      497,  497,  318,  497,  497,  497,  498,  498,  498,  317,
      498,  498,  498,  499,  499,  499,  314,  499,  499,  499,
      500,  500,  500,  313,  500,  500,  500,  501,  501,  501,
      312,  501,  501,  501,  502,  502,  502,  311,  502,  502,
      502,  503,  503,  503,  310,  503,  503,  503,  504,  504,
      504,  307,  504,  504,  504,  505,  505,  505,  306,  505,
      505,  505,  506,  506,  506,  305,  506,  506,  506,  507,
      507,  507,  304,  507,  507,  507,  508,  508,  508,  300,
      508,  508,  508,  509,  509,  509,  299,  509,  509,  509,
      510,  510,  510,  298,  510,  510,  510,  297,  296,  295,

      294,  292,  289,  286,  285,  284,  283,  281,  280,  279,
      278,  276,  275,  274,  273,  272,  271,  270,  268,  266,
      264,  263,  260,  259,  258,  257,  255,  253,  252,  251,
      250,  249,  248,  247,  246,  245,  244,  243,  242,  241,
      240,  239,  238,  236,  235,  234,  233,  232,  231,  230,
      211,  210,  209,  208,  207,  206,  205,  204,  203,  202,
      201,  200,  198,  197,  196,  195,  193,  192,  191,  189,
      184,  183,  182,  181,  180,  179,  178,  177,  176,  175,
      174,  173,  172,  171,  170,  169,  168,  166,  165,  164,
      163,  161,  160,  159,  157,  156,  154,  153,  151,  149,

      118,  117,  116,  115,  114,  113,  109,  108,  101,   96,
       93,   91,   74,   72,   47,   43,   40,   38,   29,   27,
       25,   21,   17,   16,   15,   14,   13,    8,    7,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
      472,  472,  472,  472,  472,  472,  472,  472

    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
static int yy_more_flag = 0;
static int yy_more_len = 0;
#define yymore() (yy_more_flag = 1)
#define YY_MORE_ADJ yy_more_len
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "lexor.lex"
#define INITIAL 0
#define YY_NEVER_INTERACTIVE 1
#line 5 "lexor.lex"
/*
 * Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
 *
 *    This source code is free software; you can redistribute it
 *    and/or modify it in source code form under the terms of the GNU
 *    General Public License as published by the Free Software
 *    Foundation; either version 2 of the License, or (at your option)
 *    any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */
#ifdef HAVE_CVS_IDENT
#ident "$Id: lexor.lex,v 1.86.2.4 2007/02/09 05:29:24 steve Exp $"
#endif

# include "config.h"

      //# define YYSTYPE lexval

# include  <iostream>
# include  "compiler.h"
# include  "parse_misc.h"
# include  "parse_api.h"
# include  "parse.h"
# include  <ctype.h>
# include  <string.h>
# include  "lexor_keyword.h"


# define YY_USER_INIT reset_lexor();
# define yylval VLlval

/*
 * Lexical location information is passed in the yylloc variable to th
 * parser. The file names, strings, are kept in a list so that I can
 * re-use them. The set_file_name function will return a pointer to
 * the name as it exists in the list (and delete the passed string.)
 * If the name is new, it will be added to the list.
 */
extern YYLTYPE yylloc;

struct file_name_cell {
      const char*text;
      struct file_name_cell*next;
};

static struct file_name_cell*file_names = 0;

static const char* set_file_name(char*text)
{
      struct file_name_cell*cur = file_names;
      while (cur) {
	    if (strcmp(cur->text, text) == 0) {
		  delete[]text;
		  return cur->text;
	    }

	    cur = cur->next;
      }

      cur = new struct file_name_cell;
      cur->text = text;
      cur->next = file_names;
      return text;
}


extern void pform_set_timescale(int, int, const char*file, unsigned line);

void reset_lexor();
static void line_directive();
static void line_directive2();

static verinum*make_unsized_binary(const char*txt);
static verinum*make_unsized_dec(const char*txt);
static verinum*make_unsized_octal(const char*txt);
static verinum*make_unsized_hex(const char*txt);

static int dec_buf_div2(char *buf);

static void process_timescale(const char*txt);

static int comment_enter;
#define CCOMMENT 1

#define PCOMMENT 2

#define LCOMMENT 3

#define CSTRING 4

#define UDPTABLE 5

#define PPTIMESCALE 6

#define PPDEFAULT_NETTYPE 7

#line 898 "lexor.cc"

/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif

#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif

#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif

#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif

#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( yy_current_buffer->yy_is_interactive ) \
		{ \
		int c = '*', n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
		  && ferror( yyin ) ) \
		YY_FATAL_ERROR( "input in flex scanner failed" );
#endif

/* No semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif

/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif

/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif

/* Code executed at the beginning of each rule, after yytext and yyleng
 * have been set up.
 */
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		yy_current_buffer->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

YY_DECL
	{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;

#line 107 "lexor.lex"


#line 1055 "lexor.cc"

	if ( yy_init )
		{
		yy_init = 0;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! yy_start )
			yy_start = 1;	/* first start state */

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! yy_current_buffer )
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		yy_more_len = 0;
		if ( yy_more_flag )
			{
			yy_more_len = yy_c_buf_p - yytext_ptr;
			yy_more_flag = 0;
			}
		yy_cp = yy_c_buf_p;

		/* Support of yytext. */
		*yy_cp = yy_hold_char;

		/* yy_bp points to the position in yy_ch_buf of the start of
		 * the current run.
		 */
		yy_bp = yy_cp;

		yy_current_state = yy_start;
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yy_last_accepting_state = yy_current_state;
				yy_last_accepting_cpos = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 473 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_base[yy_current_state] != 1030 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			yy_act = yy_accept[yy_current_state];
			}

		YY_DO_BEFORE_ACTION;


do_action:	/* This label is used only to access EOF actions. */


		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = yy_hold_char;
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			goto yy_find_action;

case 1:
YY_RULE_SETUP
#line 109 "lexor.lex"
{ line_directive(); }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 110 "lexor.lex"
{ line_directive2(); }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 112 "lexor.lex"
{ ; }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 113 "lexor.lex"
{ yylloc.first_line += 1; }
	YY_BREAK
/* C++ style comments start with / / and run to the end of the
     current line. These are very easy to handle. */
case 5:
YY_RULE_SETUP
#line 118 "lexor.lex"
{ comment_enter = YY_START; BEGIN(LCOMMENT); }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 119 "lexor.lex"
{ yymore(); }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 120 "lexor.lex"
{ yylloc.first_line += 1; BEGIN(comment_enter); }
	YY_BREAK
/* The contents of C-style comments are ignored, like white space. */
case 8:
YY_RULE_SETUP
#line 125 "lexor.lex"
{ comment_enter = YY_START; BEGIN(CCOMMENT); }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 126 "lexor.lex"
{ yymore(); }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 127 "lexor.lex"
{ yylloc.first_line += 1; yymore(); }
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 128 "lexor.lex"
{ BEGIN(comment_enter); }
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 131 "lexor.lex"
{ return K_PSTAR; }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 132 "lexor.lex"
{ return K_STARP; }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 133 "lexor.lex"
{ return K_LS; }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 134 "lexor.lex"
{ return K_LS; /* Note: Functionally, <<< is the same as <<. */}
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 135 "lexor.lex"
{ return K_RS; }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 136 "lexor.lex"
{ return K_RSS; }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 137 "lexor.lex"
{ return K_LE; }
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 138 "lexor.lex"
{ return K_GE; }
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 139 "lexor.lex"
{ return K_EG; }
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 140 "lexor.lex"
{ return K_SG; }
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 141 "lexor.lex"
{ return K_EQ; }
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 142 "lexor.lex"
{ return K_NE; }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 143 "lexor.lex"
{ return K_CEQ; }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 144 "lexor.lex"
{ return K_CNE; }
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 145 "lexor.lex"
{ return K_LOR; }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 146 "lexor.lex"
{ return K_LAND; }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 147 "lexor.lex"
{ return K_TAND; }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 148 "lexor.lex"
{ return K_NOR; }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 149 "lexor.lex"
{ return K_NXOR; }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 150 "lexor.lex"
{ return K_NXOR; }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 151 "lexor.lex"
{ return K_NAND; }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 152 "lexor.lex"
{ return K_TRIGGER; }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 153 "lexor.lex"
{ return K_PO_POS; }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 154 "lexor.lex"
{ return K_PO_NEG; }
	YY_BREAK
/* Watch out for the tricky case of (*). Cannot parse this as "(*"
     and ")", but since I know that this is really ( * ), replace it
     with "*" and return that. */
case 36:
YY_RULE_SETUP
#line 159 "lexor.lex"
{ return '*'; }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 162 "lexor.lex"
{ return yytext[0]; }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 164 "lexor.lex"
{ BEGIN(CSTRING); }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 165 "lexor.lex"
{ yymore(); /* Catch \\, which is a \ escaping itself */ }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 166 "lexor.lex"
{ yymore(); /* Catch \", which is an escaped quote */ }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 167 "lexor.lex"
{ BEGIN(0);
                yylval.text = strdup(yytext);
		VLerror(yylloc, "Missing close quote of string.");
		yylloc.first_line += 1;
		return STRING; }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 172 "lexor.lex"
{ BEGIN(0);
                yylval.text = strdup(yytext);
		yylval.text[strlen(yytext)-1] = 0;
		return STRING; }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 176 "lexor.lex"
{ yymore(); }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 178 "lexor.lex"
{ return '_'; }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 179 "lexor.lex"
{ return '+'; }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 180 "lexor.lex"
{ return '%'; }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 181 "lexor.lex"
{ return '*'; }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 182 "lexor.lex"
{ return 'r'; }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 183 "lexor.lex"
{ return 'Q'; }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 184 "lexor.lex"
{ return 'q'; }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 185 "lexor.lex"
{ return 'f'; /* b0 is 10|00, but only 10 is meaningful */}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 186 "lexor.lex"
{ return 'r'; /* b1 is 11|01, but only 01 is meaningful */}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 187 "lexor.lex"
{ return 'P'; }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 188 "lexor.lex"
{ return 'f'; }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 189 "lexor.lex"
{ return 'M'; }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 190 "lexor.lex"
{ return 'N'; }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 191 "lexor.lex"
{ return 'F'; }
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 192 "lexor.lex"
{ return 'R'; }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 193 "lexor.lex"
{ return 'B'; }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 194 "lexor.lex"
{ return 'b'; }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 195 "lexor.lex"
{ return 'l'; /* IVL extension */ }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 196 "lexor.lex"
{ return 'h'; /* IVL extension */ }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 197 "lexor.lex"
{ return 'f'; }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 198 "lexor.lex"
{ return 'r'; }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 199 "lexor.lex"
{ return 'x'; }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 200 "lexor.lex"
{ return 'n'; }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 201 "lexor.lex"
{ return 'p'; }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 202 "lexor.lex"
{ return yytext[0]; }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 204 "lexor.lex"
{
      int rc = lexor_keyword_code(yytext, yyleng);
      if (rc == IDENTIFIER) {
	    yylval.text = strdup(yytext);
	    if (strncmp(yylval.text,"PATHPULSE$", 10) == 0)
		  rc = PATHPULSE_IDENTIFIER;
      } else {
	    yylval.text = 0;
      }

      return rc;
 }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 218 "lexor.lex"
{
      yylval.text = strdup(yytext+1);
      return IDENTIFIER; }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 222 "lexor.lex"
{
      if (strcmp(yytext,"$setuphold") == 0)
	    return K_Ssetuphold;
      if (strcmp(yytext,"$attribute") == 0)
	    return KK_attribute;
      if (strcmp(yytext,"$hold") == 0)
	    return K_Shold;
      if (strcmp(yytext,"$period") == 0)
	    return K_Speriod;
      if (strcmp(yytext,"$recovery") == 0)
	    return K_Srecovery;
      if (strcmp(yytext,"$recrem") == 0)
	    return K_Srecrem;
      if (strcmp(yytext,"$setup") == 0)
	    return K_Ssetup;
      if (strcmp(yytext,"$width") == 0)
	    return K_Swidth;
      yylval.text = strdup(yytext);
      return SYSTEM_IDENTIFIER; }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 243 "lexor.lex"
{ yylval.number = make_unsized_dec(yytext);
                            return BASED_NUMBER; }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 245 "lexor.lex"
{ yylval.number = make_unsized_binary(yytext);
                        return BASED_NUMBER; }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 247 "lexor.lex"
{ yylval.number = make_unsized_octal(yytext);
                        return BASED_NUMBER; }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 249 "lexor.lex"
{ yylval.number = make_unsized_hex(yytext);
                              return BASED_NUMBER; }
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 252 "lexor.lex"
{
      yylval.number = make_unsized_dec(yytext);
      return DEC_NUMBER; }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 256 "lexor.lex"
{
      yylval.realtime = new verireal(yytext);
      return REALTIME; }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 260 "lexor.lex"
{
      yylval.realtime = new verireal(yytext);
      return REALTIME; }
	YY_BREAK
/* Notice and handle the timescale directive. */
case 79:
YY_RULE_SETUP
#line 267 "lexor.lex"
{ BEGIN(PPTIMESCALE); }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 268 "lexor.lex"
{ process_timescale(yytext); }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 269 "lexor.lex"
{
      yylloc.first_line += 1;
      BEGIN(0); }
	YY_BREAK
/* These are directives that I do not yet support. I think that IVL
     should handle these, not an external preprocessor. */
case 82:
YY_RULE_SETUP
#line 277 "lexor.lex"
{  }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 278 "lexor.lex"
{  }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 279 "lexor.lex"
{  }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 280 "lexor.lex"
{  }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 281 "lexor.lex"
{  }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 282 "lexor.lex"
{  }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 283 "lexor.lex"
{  }
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 284 "lexor.lex"
{  }
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 285 "lexor.lex"
{  }
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 286 "lexor.lex"
{  }
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 287 "lexor.lex"
{  }
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 288 "lexor.lex"
{  }
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 289 "lexor.lex"
{  }
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 290 "lexor.lex"
{  }
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 291 "lexor.lex"
{  }
	YY_BREAK
/* Notice and handle the default_nettype directive. The lexor
     detects the default_nettype keyword, and the second part of the
     rule collects the rest of the line and processes it. We only need
     to look for the first work, and interpret it. */
case 97:
YY_RULE_SETUP
#line 298 "lexor.lex"
{ BEGIN(PPDEFAULT_NETTYPE); }
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 299 "lexor.lex"
{
      NetNet::Type net_type;
      size_t wordlen = strcspn(yytext, " \t\f\r\n");
      yytext[wordlen] = 0;
      if (strcmp(yytext,"wire") == 0) {
	    net_type = NetNet::WIRE;

      } else if (strcmp(yytext,"none") == 0) {
	    net_type = NetNet::NONE;

      } else {
	    cerr << yylloc.text << ":" << yylloc.first_line
		 << " error: Net type " << yytext
		 << " is not a valid (and supported)"
		 << " default net type." << endl;
	    net_type = NetNet::WIRE;
	    error_count += 1;
      }
      pform_set_default_nettype(net_type, yylloc.text, yylloc.first_line);
 }
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 319 "lexor.lex"
{
      yylloc.first_line += 1;
      BEGIN(0); }
	YY_BREAK
/* These are directives that are not supported by me and should have
     been handled by an external preprocessor such as ivlpp. */
case 100:
YY_RULE_SETUP
#line 327 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `define not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 333 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `else not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 339 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `endif not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 345 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `ifdef not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 351 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `include not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 357 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": `undef not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 364 "lexor.lex"
{ cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
	    << "Stray tic (`) here. Perhaps you put white space" << endl;
       cerr << yylloc.text << ":" << yylloc.first_line << ":      : "
	    << "between the tic and preprocessor directive?"
	    << endl;
       error_count += 1; }
	YY_BREAK
/* Final catchall. something got lost or mishandled. */
case 107:
YY_RULE_SETUP
#line 373 "lexor.lex"
{   cerr << yylloc.text << ":" << yylloc.first_line
	   << ": error: unmatched character (";
      if (isgraph(yytext[0]))
	    cerr << yytext[0];
      else
	    cerr << "hex " << hex << (0xffU & ((unsigned) (yytext[0])));

      cerr << ")" << endl;
      error_count += 1; }
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 383 "lexor.lex"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 1809 "lexor.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(CCOMMENT):
case YY_STATE_EOF(PCOMMENT):
case YY_STATE_EOF(LCOMMENT):
case YY_STATE_EOF(CSTRING):
case YY_STATE_EOF(UDPTABLE):
case YY_STATE_EOF(PPTIMESCALE):
case YY_STATE_EOF(PPDEFAULT_NETTYPE):
	yyterminate();

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*yy_cp = yy_hold_char;
		YY_RESTORE_YY_MORE_OFFSET

		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between yy_current_buffer and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			yy_n_chars = yy_current_buffer->yy_n_chars;
			yy_current_buffer->yy_input_file = yyin;
			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the
		 * end-of-buffer state).  Contrast this with the test
		 * in input().
		 */
		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = yytext_ptr + YY_MORE_ADJ;

			if ( yy_next_state )
				{
				/* Consume the NUL. */
				yy_cp = ++yy_c_buf_p;
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
				yy_cp = yy_c_buf_p;
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
				yy_did_buffer_switch_on_eof = 0;

				if ( yywrap() )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				yy_c_buf_p =
					yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
				yy_c_buf_p =
				&yy_current_buffer->yy_ch_buf[yy_n_chars];

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_find_action;
			}
		break;
		}

	default:
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of yylex */


/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */

static int yy_get_next_buffer()
	{
	register char *dest = yy_current_buffer->yy_ch_buf;
	register char *source = yytext_ptr;
	register int number_to_move, i;
	int ret_val;

	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( yy_current_buffer->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
			{
			/* We matched a single character, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		yy_current_buffer->yy_n_chars = yy_n_chars = 0;

	else
		{
		int num_to_read =
			yy_current_buffer->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = yy_current_buffer;

			int yy_c_buf_p_offset =
				(int) (yy_c_buf_p - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					yy_flex_realloc( (void *) b->yy_ch_buf,
							 b->yy_buf_size + 2 );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

			if ( ! b->yy_ch_buf )
				YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = yy_current_buffer->yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
			yy_n_chars, num_to_read );

		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	if ( yy_n_chars == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart( yyin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			yy_current_buffer->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	yy_n_chars += number_to_move;
	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];

	return ret_val;
	}


/* yy_get_previous_state - get the state just before the EOB char was reached */

static yy_state_type yy_get_previous_state()
	{
	register yy_state_type yy_current_state;
	register char *yy_cp;

	yy_current_state = yy_start;
	yy_current_state += YY_AT_BOL();

	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			yy_last_accepting_state = yy_current_state;
			yy_last_accepting_cpos = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 473 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	return yy_current_state;
	}


/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	register int yy_is_jam;
	register char *yy_cp = yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 473 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	yy_is_jam = (yy_current_state == 472);

	return yy_is_jam ? 0 : yy_current_state;
	}


#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
	{
	register char *yy_cp = yy_c_buf_p;

	/* undo effects of setting up yytext */
	*yy_cp = yy_hold_char;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = yy_n_chars + 2;
		register char *dest = &yy_current_buffer->yy_ch_buf[
					yy_current_buffer->yy_buf_size + 2];
		register char *source =
				&yy_current_buffer->yy_ch_buf[number_to_move];

		while ( source > yy_current_buffer->yy_ch_buf )
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
		yy_current_buffer->yy_n_chars =
			yy_n_chars = yy_current_buffer->yy_buf_size;

		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--yy_cp = (char) c;


	yytext_ptr = yy_bp;
	yy_hold_char = *yy_cp;
	yy_c_buf_p = yy_cp;
	}
#endif	/* ifndef YY_NO_UNPUT */


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
	{
	int c;

	*yy_c_buf_p = yy_hold_char;

	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			/* This was really a NUL. */
			*yy_c_buf_p = '\0';

		else
			{ /* need more input */
			int offset = yy_c_buf_p - yytext_ptr;
			++yy_c_buf_p;

			switch ( yy_get_next_buffer() )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because yy_g_n_b()
					 * sees that we've accumulated a
					 * token and flags that we need to
					 * try matching the token before
					 * proceeding.  But for input(),
					 * there's no matching to consider.
					 * So convert the EOB_ACT_LAST_MATCH
					 * to EOB_ACT_END_OF_FILE.
					 */

					/* Reset buffer status. */
					yyrestart( yyin );

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						return EOF;

					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					yy_c_buf_p = yytext_ptr + offset;
					break;
				}
			}
		}

	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
	*yy_c_buf_p = '\0';	/* preserve yytext */
	yy_hold_char = *++yy_c_buf_p;

	yy_current_buffer->yy_at_bol = (c == '\n');

	return c;
	}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! yy_current_buffer )
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_init_buffer( yy_current_buffer, input_file );
	yy_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	if ( yy_current_buffer == new_buffer )
		return;

	if ( yy_current_buffer )
		{
		/* Flush out information for old buffer. */
		*yy_c_buf_p = yy_hold_char;
		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	yy_did_buffer_switch_on_eof = 1;
	}


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
	{
	yy_n_chars = yy_current_buffer->yy_n_chars;
	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
	yyin = yy_current_buffer->yy_input_file;
	yy_hold_char = *yy_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( ! b )
		return;

	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		yy_flex_free( (void *) b->yy_ch_buf );

	yy_flex_free( (void *) b );
	}


#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif

#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif


	{
	yy_flush_buffer( b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

#if YY_ALWAYS_INTERACTIVE
	b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
	b->yy_is_interactive = 0;
#else
	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
	}


#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif

	{
	if ( ! b )
		return;

	b->yy_n_chars = 0;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[0];

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == yy_current_buffer )
		yy_load_buffer_state();
	}


#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
	{
	YY_BUFFER_STATE b;

	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = 0;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer( b );

	return b;
	}
#endif


#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
	{
	int len;
	for ( len = 0; yy_str[len]; ++len )
		;

	return yy_scan_bytes( yy_str, len );
	}
#endif


#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
	{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;

	/* Get memory for full buffer, including space for trailing EOB's. */
	n = len + 2;
	buf = (char *) yy_flex_alloc( n );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < len; ++i )
		buf[i] = bytes[i];

	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
	}
#endif


#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
	{
	if ( yy_start_stack_ptr >= yy_start_stack_depth )
		{
		yy_size_t new_size;

		yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yy_start_stack_depth * sizeof( int );

		if ( ! yy_start_stack )
			yy_start_stack = (int *) yy_flex_alloc( new_size );

		else
			yy_start_stack = (int *) yy_flex_realloc(
					(void *) yy_start_stack, new_size );

		if ( ! yy_start_stack )
			YY_FATAL_ERROR(
			"out of memory expanding start-condition stack" );
		}

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}
#endif


#ifndef YY_NO_POP_STATE
static void yy_pop_state()
	{
	if ( --yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}
#endif


#ifndef YY_NO_TOP_STATE
static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}
#endif

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
	{
	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
	}



/* Redefine yyless() so it works in section 3 code. */

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		yytext[yyleng] = yy_hold_char; \
		yy_c_buf_p = yytext + n; \
		yy_hold_char = *yy_c_buf_p; \
		*yy_c_buf_p = '\0'; \
		yyleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst char *s2;
int n;
#endif
	{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
	}
#endif

#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
	{
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
	}
#endif


#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
	{
	/* The cast to (char *) in the following accommodates both
	 * implementations that use char* generic pointers, and those
	 * that use void* generic pointers.  It works with the latter
	 * because both ANSI C and C++ allow castless assignment from
	 * any pointer type to void*, and deal with argument conversions
	 * as though doing an assignment.
	 */
	return (void *) realloc( (char *) ptr, size );
	}

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}

#if YY_MAIN
int main()
	{
	yylex();
	return 0;
	}
#endif
#line 383 "lexor.lex"


/*
 * The UDP state table needs some slightly different treatment by the
 * lexor. The level characters are normally accepted as other things,
 * so the parser needs to switch my mode when it believes in needs to.
 */
void lex_start_table()
{
      BEGIN(UDPTABLE);
}

void lex_end_table()
{
      BEGIN(INITIAL);
}

static verinum*make_unsized_binary(const char*txt)
{
      bool sign_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }

      assert(tolower(*ptr) == 'b');
      ptr += 1;

      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 1;

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    switch (ptr[0]) {
		case '0':
		  bits[--idx] = verinum::V0;
		  break;
		case '1':
		  bits[--idx] = verinum::V1;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  break;
		  case '_':
		  break;
		default:
		  fprintf(stderr, "%c\n", ptr[0]);
		  assert(0);
	    }
	    ptr += 1;
      }

      verinum*out = new verinum(bits, size);
      out->has_sign(sign_flag);
      delete[]bits;
      return out;
}


static verinum*make_unsized_octal(const char*txt)
{
      bool sign_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }

      assert(tolower(*ptr) == 'o');
      ptr += 1;

      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 3;

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    unsigned val;
	    switch (ptr[0]) {
		case '0': case '1': case '2': case '3':
		case '4': case '5': case '6': case '7':
		  val = *ptr - '0';
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  break;
		case '_':
		  break;
		default:
		  assert(0);
	    }
	    ptr += 1;
      }

      verinum*out = new verinum(bits, size);
      out->has_sign(sign_flag);
      delete[]bits;
      return out;
}


static verinum*make_unsized_hex(const char*txt)
{
      bool sign_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }
      assert(tolower(*ptr) == 'h');

      ptr += 1;
      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 4;

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    unsigned val;
	    switch (ptr[0]) {
		case '0': case '1': case '2': case '3': case '4':
		case '5': case '6': case '7': case '8': case '9':
		  val = *ptr - '0';
		  bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
		case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
		  val = tolower(*ptr) - 'a' + 10;
		  bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  break;
		case '_':
		  break;
		default:
		  assert(0);
	    }
	    ptr += 1;
      }

      verinum*out = new verinum(bits, size);
      out->has_sign(sign_flag);
      delete[]bits;
      return out;
}


/* Divide the integer given by the string by 2. Return the remainder bit. */
static int dec_buf_div2(char *buf)
{
    int partial;
    int len = strlen(buf);
    char *dst_ptr;
    int pos;

    partial = 0;
    pos = 0;

    /* dst_ptr overwrites buf, but all characters that are overwritten
       were already used by the reader. */
    dst_ptr = buf;

    while(buf[pos] == '0')
	++pos;

    for(; pos<len; ++pos){
	if (buf[pos]=='_')
	    continue;

	assert(isdigit(buf[pos]));

	partial= partial*10 + (buf[pos]-'0');

	if (partial >= 2){
	    *dst_ptr = partial/2 + '0';
	    partial = partial & 1;

	    ++dst_ptr;
	}
	else{
	    *dst_ptr = '0';
	    ++dst_ptr;
	}
    }

    // If result of division was zero string, it should remain that way.
    // Don't eat the last zero...
    if (dst_ptr == buf){
	*dst_ptr = '0';
	++dst_ptr;
    }
    *dst_ptr = 0;

    return partial;
}

/*
 * Making a decimal number is much easier then the other base numbers
 * because there are no z or x values to worry about. It is much
 * harder then other base numbers because the width needed in bits is
 * hard to calculate.
 */

static verinum*make_unsized_dec(const char*ptr)
{
      char buf[4096];
      bool signed_flag = false;
      unsigned idx;

      if (ptr[0] == '\'') {
	      /* The number has decorations of the form 'sd<digits>,
		 possibly with space between the d and the <digits>.
		 Also, the 's' is optional, and markes the number as
		 signed. */
	    ptr += 1;

	    if (tolower(*ptr) == 's') {
		  signed_flag = true;
		  ptr += 1;
	    }

	    assert(tolower(*ptr) == 'd');
	    ptr += 1;

	    while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
		  ptr += 1;

      } else {
	      /* ... or an undecorated decimal number is passed
		 it. These numbers are treated as signed decimal. */
	    assert(isdigit(*ptr));
	    signed_flag = true;
      }


	/* Copy the digits into a buffer that I can use to do in-place
	   decimal divides. */
      idx = 0;
      while ((idx < sizeof buf) && (*ptr != 0)) {
	    if (*ptr == '_') {
		  ptr += 1;
		  continue;
	    }

	    buf[idx++] = *ptr++;
      }

      if (idx == sizeof buf) {
	    fprintf(stderr, "Ridiculously long"
		    " decimal constant will be truncated!\n");
	    idx -= 1;
      }

      buf[idx] = 0;
      unsigned tmp_size = idx * 4 + 1;
      verinum::V *bits = new verinum::V[tmp_size];

      idx = 0;
      while (idx < tmp_size) {
	    int rem = dec_buf_div2(buf);
	    bits[idx++] = (rem == 1) ? verinum::V1 : verinum::V0;
      }

      assert(strcmp(buf, "0") == 0);

	/* Now calculate the minimum number of bits needed to
	   represent this unsigned number. */
      unsigned size = tmp_size;
      while ((size > 1) && (bits[size-1] == verinum::V0))
	    size -= 1;

	/* Now account for the signedness. Don't leave a 1 in the high
	   bit if this is a signed number. */
      if (signed_flag && (bits[size-1] == verinum::V1)) {
	    size += 1;
	    assert(size <= tmp_size);
      }

      verinum*res = new verinum(bits, size, false);
      res->has_sign(signed_flag);

      delete[]bits;
      return res;
}


/*
 * The timescale parameter has the form:
 *      " <num> xs / <num> xs"
 */
static void process_timescale(const char*txt)
{
      unsigned num;
      const char*cp = txt + strspn(txt, " \t");
      char*tmp;
      const char*ctmp;

      int unit = 0;
      int prec = 0;

      num = strtoul(cp, &tmp, 10);
      if (num == 0) {
	    VLerror(yylloc, "Invalid timescale string.");
	    return;
      }

      while (num >= 10) {
	    unit += 1;
	    num  /= 10;
      }
      if (num != 1) {
	    VLerror(yylloc, "Invalid timescale unit number.");
	    return;
      }

      cp = tmp;
      cp += strspn(cp, " \t");
      ctmp = cp + strcspn(cp, " \t/");

      if (strncmp("s", cp, ctmp-cp) == 0) {
	    unit -= 0;

      } else if (strncmp("ms", cp, ctmp-cp) == 0) {
	    unit -= 3;

      } else if (strncmp("us", cp, ctmp-cp) == 0) {
	    unit -= 6;

      } else if (strncmp("ns", cp, ctmp-cp) == 0) {
	    unit -= 9;

      } else if (strncmp("ps", cp, ctmp-cp) == 0) {
	    unit -= 12;

      } else if (strncmp("fs", cp, ctmp-cp) == 0) {
	    unit -= 15;

      } else {
	    VLerror(yylloc, "Invalid timescale unit of measurement");
	    return;
      }

      cp = ctmp;
      cp += strspn(cp, " \t/");

      num = strtoul(cp, &tmp, 10);
      if (num == 0) {
	    VLerror(yylloc, "Invalid timescale string.");
	    return;
      }
      assert(num);
      while (num >= 10) {
	    prec += 1;
	    num  /= 10;
      }
      if (num != 1) {
	    VLerror(yylloc, "Invalid timescale precision number.");
	    return;
      }

      cp = tmp;
      cp += strspn(cp, " \t");
      ctmp = cp + strcspn(cp, " \t\r");

      if (strncmp("s", cp, ctmp-cp) == 0) {
	    prec -= 0;

      } else if (strncmp("ms", cp, ctmp-cp) == 0) {
	    prec -= 3;

      } else if (strncmp("us", cp, ctmp-cp) == 0) {
	    prec -= 6;

      } else if (strncmp("ns", cp, ctmp-cp) == 0) {
	    prec -= 9;

      } else if (strncmp("ps", cp, ctmp-cp) == 0) {
	    prec -= 12;

      } else if (strncmp("fs", cp, ctmp-cp) == 0) {
	    prec -= 15;

      } else {
	    VLerror(yylloc, "Invalid timescale precision units of measurement");
	    return;
      }

      pform_set_timescale(unit, prec, yylloc.text, yylloc.first_line);
}

int yywrap()
{
      return 1;
}

/*
 * The line directive matches lines of the form #line "foo" N and
 * calls this function. Here I parse out the file name and line
 * number, and change the yylloc to suite.
 */
static void line_directive()
{
      char*qt1 = strchr(yytext, '"');
      assert(qt1);
      qt1 += 1;

      char*qt2 = strchr(qt1, '"');
      assert(qt2);

      char*buf = new char[qt2-qt1+1];
      strncpy(buf, qt1, qt2-qt1);
      buf[qt2-qt1] = 0;

      yylloc.text = set_file_name(buf);

      qt2 += 1;
      yylloc.first_line = strtoul(qt2,0,0);
}

static void line_directive2()
{
      assert(strncmp(yytext,"`line",5) == 0);
      char*cp = yytext + strlen("`line");
      cp += strspn(cp, " ");
      yylloc.first_line = strtoul(cp,&cp,10);

      yylloc.first_line -= 1;

      cp += strspn(cp, " ");
      if (*cp == 0) return;

      char*qt1 = strchr(yytext, '"');
      assert(qt1);
      qt1 += 1;

      char*qt2 = strchr(qt1, '"');
      assert(qt2);

      char*buf = new char[qt2-qt1+1];
      strncpy(buf, qt1, qt2-qt1);
      buf[qt2-qt1] = 0;

      yylloc.text = set_file_name(buf);
}

extern FILE*vl_input;
void reset_lexor()
{
      yyrestart(vl_input);
      yylloc.first_line = 1;

	/* Start the file_names list. From here on, as I get a file
	   name, I will add it to this list. Only add the name if it
	   is not already in the list. */
      file_names = new struct file_name_cell;
      file_names->text = strdup(vl_file.c_str());
      file_names->next = 0;
      yylloc.text = file_names->text;
}
